//
//  ScheduleModel.m
//  EducationAdminClient
//
//  Created by 孙添凤 on 17/1/24.
//  Copyright © 2017年 周佳兴. All rights reserved.
//

#import "ScheduleModel.h"

@implementation ScheduleModel

+(JSONKeyMapper*)keyMapper {
    
    /* 注意JuhuiModel里面需要映射2种类型
     1. 驼峰Camel命名规范
     2. 把author.header_img和author_username要映射到JuhuiModel直接字段里面 */
    JSONKeyMapper *mapper = [JSONKeyMapper mapperFromUnderscoreCaseToCamelCase];
    // 取得影射的blocks对象
    JSONModelKeyMapBlock modelBlock = mapper.modelToJSONKeyBlock;
    
    // 根据上述的重新创建映射条件
    JSONKeyMapper *newMapper = [[JSONKeyMapper alloc] initWithJSONToModelBlock:nil modelToJSONBlock:^NSString *(NSString *keyName) {
        // 告诉我们影射规律
        if ([keyName isEqualToString:@"CM_TYPE"]) {
            return @"CM_TYPE";
        } else if ([keyName isEqualToString:@"CONFLICT_CONTENT"]) {
            return @"CONFLICT_CONTENT";
        } else if ([keyName isEqualToString:@"DATA_ID"]) {
            return @"DATA_ID";
        } else if ([keyName isEqualToString:@"END_TIME"]) {
            return @"END_TIME";
        }else if ([keyName isEqualToString:@"IFSEE"]) {
            
            return @"IFSEE";
        }else if ([keyName isEqualToString:@"MAIN_DATA_ID"]) {
            
            return @"MAIN_DATA_ID";
        }else if ([keyName isEqualToString:@"OS_NAME"]) {
            
            return @"OS_NAME";
        }else if ([keyName isEqualToString:@"SHOW_CONTENT"]) {
            
            return @"SHOW_CONTENT";
        }else if ([keyName isEqualToString:@"START_TIME"]) {
            
            return @"START_TIME";
        }else if ([keyName isEqualToString:@"TABLE_ID"]) {
            
            return @"TABLE_ID";
        }else if ([keyName isEqualToString:@"courseInfo"]) {
            
            return @"courseInfo";
        }else if ([keyName isEqualToString:@"CLASSROOM_NAME"]) {
            
            return @"CLASSROOM_NAME";
        }
        return modelBlock(keyName);
    }];
    return newMapper;
    
    
    //return [JSONKeyMapper mapperFromUnderscoreCaseToCamelCase];
}


+(BOOL)propertyIsOptional:(NSString*)propertyName {
    return  YES;
}


@end
